package com.education.user.service;

import com.education.user.mapper.TeacherMapper;
import com.education.user.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherService {

    @Autowired
    private TeacherMapper teacherMapper;


    //主键搜索
    public Teacher selectById(Integer id){
        return teacherMapper.selectByPrimaryKey(id);
    }

    //条件查询集合
    public List<Teacher> select(Teacher school){
        return teacherMapper.select(school);
    }

    //添加数据
    public int insert(Teacher school){
        return teacherMapper.insertSelective(school);
    }

    //修改
    public int update(Teacher school){
        return teacherMapper.updateByPrimaryKeySelective(school);
    }

    //批量删除
    public int delete(int id){
        return teacherMapper.deleteByPrimaryKey(id);
    }

}
